package com.ybbase.framework.model.po.system;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 系统机构
 * </p>
 *
 * @author cg
 * @since 2019-11-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_organization")
@ApiModel(value="Organization对象", description="系统机构")
public class Organization extends Model<Organization> {

    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "唯一编码")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "所属区域编码")
    private Integer areaId;

    @ApiModelProperty(value = "创建人")
    @TableField(fill = FieldFill.INSERT)
    private Integer createBy;

    @ApiModelProperty(value = "创建时间 : 创建时间")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createDate;

    @ApiModelProperty(value = "更新人 : 更新人")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Integer updateBy;

    @ApiModelProperty(value = "更新人 : 更新人")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    @ApiModelProperty(value = "备注")
    private String remarks;

    @ApiModelProperty(value = "删除标示 : 0未删除 1已删除")
    @TableLogic
    private Integer delFlag;

    @ApiModelProperty(value = "乐观锁版本管理")
    private Integer version;

    @ApiModelProperty(value = "父节点编码 : 父节点编码")
    private Integer parentId;

    @ApiModelProperty(value = "上级名称")
    private String parentName;

    @ApiModelProperty(value = "当前路径")
    private String path;

    @ApiModelProperty(value = "排序")
    private Integer sort;

    @ApiModelProperty(value = "机构名称")
    private String name;

    @ApiModelProperty(value = "机构编码")
    private String code;

    @ApiModelProperty(value = "机构类型 : （1：集团；2：企业  3部门）")
    private Integer type;

    @ApiModelProperty(value = "联系地址")
    private String address;

    @ApiModelProperty(value = "邮政编码")
    private String zipCode;

    @ApiModelProperty(value = "负责人")
    private String master;

    @ApiModelProperty(value = "负责人电话号码")
    private String phone;

    @ApiModelProperty(value = "传真")
    private String fax;

    @ApiModelProperty(value = "邮箱")
    private String email;

    @ApiModelProperty(value = "流程类型")
    private String flowType;

    @ApiModelProperty(value = "创建的部门ID")
    @TableField(fill = FieldFill.INSERT)
    private Integer organId;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    /****************************************扩展*/

    @ApiModelProperty("岗位列表")
    @TableField(exist = false)
    public List<Post> postList;
}
